/**
 * 留言模块
 **/
package com.kitchen.ui.dialog.words
{
	import com.kitchen.ui.box9grid.BetweenBox;
	import com.kitchen.ui.box9grid.InnerBox;
	import com.kitchen.ui.box9grid.OuterBox;
	import com.kitchen.ui.dialog.AbstractDialog;
	import com.kitchen.ui.dialog.DialogHeader;
	
	import flash.display.BitmapData;
	import flash.text.TextField;
	import flash.text.TextFieldAutoSize;
	import flash.text.TextFieldType;
	import flash.text.TextFormat;

	public class LeaveWordsDialog extends AbstractDialog
	{
		private var tfcontent:TextField;
		
		public function LeaveWordsDialog(main:BitmapData, dialog:BitmapData, shoper:Object=null, shop:Object=null)
		{
			super(main, dialog, shoper, shop);
		}
		
		override public function getData():Object{
			var data:Object = new Object;
			return data;
		}
		
		override protected function layout(cdata:Object):void{
			this.w = 450;
			this.h = 425;
			var outer:OuterBox = new OuterBox(this.dialogSkin, 450, 410);
			var between:BetweenBox = new BetweenBox(this.dialogSkin, 425, 310);
			var inner:InnerBox = new InnerBox(this.dialogSkin, 400, 220);
			outer.x = 0;
			outer.y = 20;
			between.x = 10;
			between.y = 105;
			inner.x = 20;
			inner.y = 150;
			this.addChild(outer);
			this.addChild(between);
			this.addChild(inner);
			var head:WordsHead = new WordsHead(this.mainSkin);
			head.x = (this.w-head.w)/2;
			head.y = 0;
			this.addChild(head);
			this.addCloseButton();
			var leaveword:LeaveWordsIcon = new LeaveWordsIcon(this.dialogSkin);
			leaveword.x =35;
			leaveword.y = 124;
			this.addChild(leaveword);
			var tf1:TextField = new TextField();
			tf1.text = '写信给';
			tf1.x = 35;
			tf1.y = 165;
			tf1.selectable =false;
			tf1.setTextFormat(new TextFormat('黑体', 15, 0x592f09, true));
			this.addChild(tf1);
			
			var tf2:TextField = new TextField();
			tf2.text = this.shoper.sUname+':';
			tf2.x = 90;
			tf2.y = 166;
			tf2.selectable = false;
			tf2.autoSize = TextFieldAutoSize.LEFT;
			tf2.setTextFormat(new TextFormat('黑体', 12, 0xff0000, true));
			this.addChild(tf2);
			var tfbg:NoteBack = new NoteBack(25, 360, 6, 1);
			tfbg.x = 35;
			tfbg.y = 200;
			this.addChild(tfbg);
			this.tfcontent = new TextField();
			this.tfcontent.alpha = 0.01;
			this.tfcontent.type = TextFieldType.INPUT;
			this.tfcontent.wordWrap = true;
			this.tfcontent.multiline = true;
			this.tfcontent.maxChars = 180;
			this.tfcontent.text = '';
			this.tfcontent.x = 35;
			this.tfcontent.y = 200;
			this.tfcontent.height = 160;
			this.tfcontent.width = 360;
			var tf:TextFormat = new TextFormat('黑体', 13, 0x333333, false);
			tf.leading = 10;
			tf.blockIndent = 5;
			tf.letterSpacing = 1;
			this.tfcontent.defaultTextFormat = tf
			this.addChild(this.tfcontent);
			this.addSureButton();
		}
		
	}
}